{template head}
<script type="text/javascript">
var ajaxparam = {
		'url' : '{SITE_URL}/ajax/index.php'
};
function deladmin(id,status,str){
	if(id)
	{
		
		layer.confirm('你确定执行'+str+'操作吗？', {
		  time: 0 //不自动关闭
		  ,btn: ['很确定', '点错了']
		  ,yes: function(index){
		    layer.close(index);
		    
		    
		    var url = ajaxparam.url + '?m=gggStatus';
			var data = {
					'id' : id,
					'status':status,
					'str':str,
			};
			var callback = function(data){
				if(data.sign == 1)
				{
					layer.alert(data.msg,function(){
						window.location = window.location;
					});
				}
				else
				{
					if(data.msg)
					{
						layer.msg(data.msg);
					}
					else
					{
						layer.msg('操作失败');
					}
				}
			};
			makeAjax('post',url,data,callback);
		    
		    
		    
		    
		    
		    
		    
		    
		  }
		});
		
		
		
		
	}else{
		alert('参数错误');
	}
}
</script>
<body>
<div class="wrapper">
	<div class="crumbs"><span style="margin: 0 5px;color: #333;font-size: 14px;">{$fTitle} &gt; {$sTitle}</span></div>
	
	<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
	  	<ul class="layui-tab-title">
	   	 	<a href="{SITE_URL}index.php?a={$action}&m=pc"><li {if $method=='pc'}class="layui-this"{/if}>Pc</li></a>
	    	<a href="{SITE_URL}index.php?a={$action}&m=touch"><li {if $method=='touch'}class="layui-this"{/if}>Touch</li></a>
		    <a href="{SITE_URL}index.php?a={$action}&m=app"><li {if $method=='app'}class="layui-this"{/if}>App</li></a>
	  	</ul>
	</div>      
	      
	
	
	<div class="container_tit clearfix mb20 ft14">
	
	<form action="{SITE_URL}index.php?a={$action}&m=pc" method="get">
		<input type="hidden" name="a" value="{$action}" />
	
        <div class="btn_box fl">
        	{if adminpermission('N','100000','100001')}
        	<a href="{SITE_URL}index.php?a={$action}&m=add&type=pc" class="btnyellow mr15">创建Banner</a>
        	{/if}
        </div>
    </form>
    </div>
	
	<!-- list -->
	<table class="table">
		<thead>
			<tr class="bg_h_1">
				<th width="">排序</th>
				<th width="">标题（Pc）</th>
				<th width="">缩略图（Pc）</th>
				<th width="">链接（Pc）</th>
				<th width="">开始时间</th>
				<th width="">结束时间</th>
				<th width="">状态</th>
            	<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
		<!--{loop $list $key $one}-->
			<tr>
				<td style="text-align: center;">
					{$one['sort']}
				</td>
				<td style="text-align: center;">
					{$one['title']}
				</td>
				<td style="text-align: center;">
					<img src="{OSS_URL}{$one[tupian]}" style="width:65px;height:30px;" />
				</td>
				<td style="text-align: center;">{$one['url']}</td>
				<td style="text-align: center;">{php echo time_formart($one['start'],1)}</td>
				<td style="text-align: center;">{php echo time_formart($one['end'],1)}</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						禁用
					{elseif $one[status] == 2}
						启用
					{/if}
				</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						{if adminpermission('N','100000','100003')}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','2','启用')" class="btn_set"  title="启用">启用</a>
						{/if}
						{if adminpermission('N','100000','100004')}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','3','删除')" class="btn_del"  title="删除">删除</a>
						{/if}
					{elseif $one[status] == 2}
						{if adminpermission('N','100000','100003')}
						<a href="javascript:;" onclick="deladmin('{$one[id]}','1','禁用')" class="btn_set"  title="禁用">禁用</a>
						{/if}
					{/if}
					{if adminpermission('N','100000','100002')}
					<a class="btn_edit" href="{SITE_URL}index.php?a={$action}&m=edit&id={$one[id]}"  title="编辑">编辑</a>
					{/if}
				</td>
			</tr>
		<!--{/loop}-->
		</tbody>
	</table>
</div>

<!--{php pagenav($pageurl,$page,$pagetotal);}-->
{template foot}